function setCookie( name, value, expiredays )
{
        var todayDate = new Date();
        todayDate.setDate( todayDate.getDate() + expiredays );
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function getCookie(NameCookie) {
        var i = document.cookie.indexOf( NameCookie+'=' );
        if (i != -1) {
                i += NameCookie.length + 1;
                NameEnd = document.cookie.indexOf(';', i);
                if (NameEnd == -1) {
                  NameEnd = document.cookie.length;
                }
                return  unescape(document.cookie.substring(i, NameEnd));
        } else {
          return "";
        }
}